/*
 * Project : Linuxbox
 * File    : UserManUpdate.java
 * Version : 1.0
 * Author  : Kevin Zhang
 *
 * Copyright (c) 2000-2001 by Linuxbox, Inc.
 * All rights reserved.
 */
package linuxbox.bbs.servlet;

import javax.servlet.http.*;

import linuxbox.BoxStatic;
import linuxbox.common.*;
import linuxbox.bbs.logic.*;

public class BbsCatUpdateAction extends Action {
	protected static final String BBS_CAT_ID_PARAM = "CAT_ID";         
	protected static final String BBS_CAT_NAME_PARAM = "CAT_NAME";

	protected static String successJSP = null;
	
    public void doAction(HttpSession aSession, BoxSession aBoxSession, 
    HttpServletRequest req, HttpServletResponse res) throws Exception {
		BoxStatic.logger.debug("I am in BbsCatUpdateAction now ... ");
		
		String CatID = req.getParameter(BBS_CAT_ID_PARAM);
		String CatName = req.getParameter(BBS_CAT_NAME_PARAM);
	
		BoxStatic.logger.debug("CatID is " + CatID);
		BoxStatic.logger.debug("CatName is " + CatName);
		
		BbsCat cat = new BbsCat(Integer.parseInt(CatID), CatName);
		BbsManager bm = BbsManager.getInstance();
		bm.modifyBbsCat(cat);
		
		redirectFile(successJSP, req, res);
		
		BoxStatic.logger.debug("I am leaving BbsCatUpdateAction now ... ");
	}

	public void setSuccessJSP(String str) {
		successJSP = str;
	}
}
